#include "stdafx.h"
#include "PushButton.h"

#include "2DUtils.h"
#include "Text.h"

using namespace mgui;

PushButton::PushButton( const Rect & bounds, const std::string & text )
{
	setBounds(bounds);
	Text = text;
}

void PushButton::drawSelf()
{
	mgfx::Utils2D::drawRect(mBounds.X, mBounds.Y, mBounds.Width, mBounds.Height, XMVectorSet(0.1f, 0.1f, 0.1f, 0.0f));
	mgfx::Text2D::draw(Text, mBounds.X, mBounds.Y);
}

bool PushButton::processLButtonUpInside( const Point & pt )
{
	EventArgs args;
	callListeners(EVENT_PUSHED, args);

	return true;
}
